package greedyAlgorithm;
//移动零
public class moveZeroes {
   public static void moveZeroe(){
       int nums[]={0,1,0,3,1,0,2};
       int cur=0,dest=-1;
        for(cur=0;cur<nums.length;cur++){
            if(nums[cur]!=0){
                dest++;
                int tmp=nums[cur];
                nums[cur]=nums[dest];
                nums[dest]=tmp;
            }
        }
        for(int x:nums ){
            System.out.print(x+" ");
        }
    }
    public static void main(String[] args) {
        moveZeroe();
    }
}

